package com.todo.biz.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author zhangwenxiang
 * @date 2024/3/13 20:09
 * @description
 */
@Getter
@AllArgsConstructor
public enum ExamineOperateEnum {

    AUTO(1, "AUTO", "自动化审核"),
    MANUAL(2, "MANUAL", "人工审核"),
    AUTO_TO_MANUAL(3, "AUTO_TO_MANUAL", "自动化转人工"),
    ;

    private static Map<Integer, ExamineOperateEnum> typeMap = Arrays
            .stream(ExamineOperateEnum.values())
            .collect(Collectors.toMap(ExamineOperateEnum::getType, item -> item, (v1, v2) -> v2));

    private int type;
    private String code;
    private String name;


    public static ExamineOperateEnum getByType(Integer type) {
        return typeMap.get(type);
    }
}
